<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">
        table {border-collapse: collapse;font-size: 14px;width: 1000px;margin: auto}
        table,th,td{border: 1px solid darkslategray;padding: 10px}
    </style>
</head>
<body>
    <div style="text-align: center">
        <span style="color: darkslategray;font-size: 30px">欢迎光临</span>
        <hr/>
        <br>
        <a th:href="@{/student/toadd}"><button value="添加">添加</button></a>
        <table class="list">
            <tr>
                <th>id</th>
                <th>姓名</th>
                <th>年龄</th>
                <th>性别</th>
                <th>生日</th>
                <th colspan="2">操作</th>
            </tr>
            <tr th:each="user : ${list}">
                <td th:text="${user.id}"></td>
                <td th:text="${user.name}"></td>
                <td th:text="${user.age}"></td>
                <td th:text="${user.sex=='1'}?'男':'女'"></td>
                <td th:text="${#dates.format(user.birthday,'yyyy-MM-dd')}"></td>
                <td><a th:href="@{/student/toupdate(id=${user.id})}"><button value="修改">修改</button></a></td>
                <td><a th:href="@{/student/delStu(id=${user.id})}"><button value="删除">删除</button></a></td>
            </tr>
        </table>
    </div>
</body>
</html>